package com.my.ddd_sample_collections.aggregate_change_tracking.abstract_domain;

import com.my.ddd_sample_collections.aggregate_change_tracking.repository_framework.DomainObjectSupport;
import lombok.Data;
import lombok.experimental.SuperBuilder;

import java.util.Objects;

@SuperBuilder
@Data
public class AbstractItemDO extends DomainObjectSupport {
    private int seq;
    private String name;
    private int count;
    
    public int getSeq() {
        return seq;
    }
    
    public void setSeq(int seq) {
        if (!Objects.deepEquals(this.seq, seq)) {
            track(this, this.seq, "seq", seq);
        }
        this.seq = seq;
    }
    
    public String getName() {
        return name;
    }
    
    protected void setName(String name) {
        if (!Objects.deepEquals(this.name, name)) {
            track(this, this.name, "name", name);
        }
        this.name = name;
    }
    
    public int getCount() {
        return count;
    }
    
    public void setCount(int count) {
        if (!Objects.deepEquals(this.count, count)) {
            track(this, this.count, "count", count);
        }
        this.count = count;
    }
}
